<template>
  <div>
<ul>
    <li v-for="item,index in arr" :key="index">{{item}}
    </li>
</ul>
<button @click="reverse">翻转数组</button>
<button @click="jiequ">截取数组</button>
<button @click="gai">修改数组</button>
  </div>
</template>

<script>
export default {
data(){
    return{
arr:[1,2,3,4]
    }
},
methods:{
    reverse(){
        this.arr.reverse()
    },
    jiequ(){
        this.arr=this.arr.slice(0,3)
    },
    gai(){
        // this.arr[0]=7
        this.$set(this.arr,2,6)
    }
}
}
</script>

<style>

</style>